﻿using SimpleExcel.Test.Model;
using System;
using System.Collections.Generic;
using System.IO;
using SimpleExcel.Core.Extensions;

namespace SimpleExcel.Test
{
    class Program
    {
        static void Main(string[] args)
        {

            List<PersonDto> persons = new List<PersonDto>();
            for (int i = 0; i < 10; i++)
            {
                var person = GetPerson(i + 1, $"aqa{i}", 17 + i, EnumSex.男, $"Modern architecture to create maintainable software solutions.{i.ToString()}");
                persons.Add(person);
            }
            File.WriteAllBytes($"test_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx", persons.ToByteExcel());
        }


        static PersonDto GetPerson(int id, string name, int age, EnumSex sex, string desc)
        {
            PersonDto personDto = new PersonDto();
            personDto.Id = id;
            personDto.Name = name;
            personDto.Age = age;
            personDto.Sex = sex;
            personDto.Desc = desc;

            return personDto;
        }


    }
}
